<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>双向绑定</title>
</head>
<body>
<div id="app">
    <p>{{msg}}</p>
    <input type="text"  v-model:value="msg">
    <div>
        <p>用户名:<input type="text" v-model:value="user.name"></p>
        <p>年龄:<input type="text" v-model:value="user.age"></p>
        <p>性别:<input type="text" v-model:value="user.sex"></p>
    </div>
    <p><button @click="users.push(user.name,user.age,user.sex)">保存</button></p>
    <p>{{users}}</p>
</div>
</body>
</html>
<script src="./js/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            msg: 'Hello Vue!',
            user:{
                name:"zhangsan",
                age:18,
                sex:1
            },
            users:[]
        }
    })
</script>